<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
		<title>Title</title>
		<link rel="shortcut icon" th:href="@{/picture/favicon.ico}"/>
		<link rel="stylesheet" type="text/css" th:href="@{/css/bootstrap.min.css}"/>
		<link th:href="@{/css/auth/work_add.css}" rel="stylesheet">
		<script th:src="@{/js/jquery-3.4.1.min.js}" type="text/javascript" charset="utf-8"></script>
		<script th:src="@{/js/bootstrap.min.js}" type="text/javascript" charset="utf-8"></script>
		<script th:src="@{/js/auth/work_add.js}"></script>
</head>
<body>
<div class="container-fluid">
		<div class="row-fluid">
				<div class="span12">
						<div class="tabbable" id="tabs-535382">
								<ul class="nav nav-tabs">
										<li >
												<a href="#newnovel" data-toggle="tab">新建小说</a>
										</li>
										<li class="active">
												<a href="#write" data-toggle="tab">写作</a>
										</li>
								</ul>
								<div class="tab-content">
										<div class="tab-pane" id="newnovel">
												<form class="form-horizontal">
														<div class="control-group">
																<label class="control-label" for="novelName">小说名</label>
																<div class="controls">
																		<input id="novelName" name="book_name"
																		       type="text"/>
																</div>
														</div>
														<div class="control-group">
																<label class="control-label"
																       for="novelAuthor">作者</label>
																<div class="controls">
																		<input id="novelAuthor" name="book_author"
																		       type="text" disabled
																		       th:value="${session.user_auth.nickName}"/>
																</div>
														</div>
														<div class="control-group">
																<label class="control-label"
																       for="novelStatus">状态</label>
																<div class="controls">
																		<input id="novelStatus" name="book_state"
																		       type="text" disabled value="连载"/>
																</div>
														</div>
														<div class="control-group">
																<label class="control-label" for="novelType">类型</label>
																<div class="controls">

																		<div id="novelType"
																		     style="margin-left: 20px;font-size: 19px">
																				<div th:each="type:${types}">
																				[[${type.typeName}]]: <input
																						type="checkbox" name="types"
																						th:value="${type.typeName}"
																						style="margin-right: 15px">
																				</div>
																		</div>
																</div>
														</div>
														<div class="control-group">
																<label class="control-label" for="novelIntro">简介</label>
																<div class="controls">
																		<input id="novelIntro" name="book_intro"
																		       type="text"/>
																</div>
														</div>
														<div class="control-group">
																<label class="control-label" for="addBtn"></label>
																<div class="controls">
																		<button type="button"
																		        class="btn btn-success btn-lg"
																		        id="addBtn">新建
																		</button>
																</div>
														</div>
												</form>
										</div>
										<div class="tab-pane active" id="write">

												<div id="work_list">
														<table>
																<thead>
																<tr>
																		<th>书名</th>
																		<th>更新时间</th>
																		<th>最新章节</th>
																		<th>操作</th>
																</tr>
																</thead>
																<tbody>
																		<tr th:each="book,VS:${work}">
																				<td th:id="'cat'+${VS.index+1}">[[${book.bookName}]]</td>
																				<td>
																						[[${#dates.format(book.updateTime, 'yyyy年MM月dd日')}]]
																				</td>
																				<td>
																						<span th:each="catalog,vs:${book.bookCatalog}">
																								<span th:if="${vs.last}">[[${catalog.novelCatalog!=null?catalog.novelCatalog:"暂无章节"}]]</span>
																						</span>
																				</td>
																				<td>
																						<a id="add_catalog"
																						   th:href="@{'/auth/toedit?catalogname='+${book.bookCatalog[book.bookCatalog.size()-1]==null?'0':book.bookCatalog[book.bookCatalog.size()-1].novelCatalog}+'&novelname='+${book.bookName}}"
																						target="_blank">开新章</a>
																						<a th:onclick="'showCatalog('+${VS.index+1}+')'">查看所有章节</a>
																				</td>
																		</tr>
																</tbody>
														</table>
												</div>
												<div style="display: none" id="catalog_list">
														<div class="catalog_list_top"><span id="back_list" style="color:red;">返回列表</span><h4 style="color: #2aabd2"></h4></div>
														<div class="catalog_list_content">
																<table>
																		<tbody>

																		</tbody>
																</table>
														</div>
												</div>

										</div>
								</div>
						</div>

				</div>
		</div>
</div>
</body>
</html>